﻿using System;
using System.Collections;

namespace ExamServer.Entities
{
	/// <summary>
	/// 实体类 Admin 映射到数据库表 'tb_Admin' 
	/// 管理员
	/// 自动生成代码， 创建时间: 2011/3/30
	/// </summary>
	public class Admin
	{
		#region Member Variables
		
		/// <summary>
		/// 每个管理员的唯一自增ID
		/// </summary>
		protected int admin_id;
		public int AdminId
		{
			get {return admin_id;}
			set {admin_id = value;}
		}
		
		/// <summary>
		/// 管理员的名字
		/// </summary>
		protected string admin_name;
		public string AdminName
		{
			get { return admin_name; }
			set
			{
				if ( value != null && value.Length > 50)
					throw new ArgumentOutOfRangeException("Invalid value for AdminName", value, value.ToString());
				admin_name = value;
			}
		}
		
		/// <summary>
		/// 管理员密码
		/// </summary>
		protected string admin_password;
		public string AdminPassword
		{
			get { return admin_password; }
			set
			{
				if ( value != null && value.Length > 32)
					throw new ArgumentOutOfRangeException("Invalid value for AdminPassword", value, value.ToString());
				admin_password = value;
			}
		}
		
		/// <summary>
		/// 管理员的邮箱
		/// </summary>
		protected string admin_email;
		public string AdminEmail
		{
			get { return admin_email; }
			set
			{
				if ( value != null && value.Length > 100)
					throw new ArgumentOutOfRangeException("Invalid value for AdminEmail", value, value.ToString());
				admin_email = value;
			}
		}
		
		/// <summary>
		/// 管理员的权限等级
		/// </summary>
		protected int admin_level;
		public int AdminLevel
		{
			get { return admin_level; }
			set { admin_level = value; }
		}
		
		
		

		#endregion

		#region Constructors

		public Admin() { }

		public Admin( string admin_name, string admin_password, string admin_email, int admin_level )
		{
			this.admin_name = admin_name;
			this.admin_password = admin_password;
			this.admin_email = admin_email;
			this.admin_level = admin_level;
		}

		#endregion

	}
}